package com.harisucici.websocketlib.room;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import com.harisucici.websocketlib.entities.receive.MyFriends;

@Database(entities = {MyFriends.class}, version = 1, exportSchema = false)
public abstract class MyFriendsDataBase extends RoomDatabase {
    private static MyFriendsDataBase myFriendsDataBase;

    public static synchronized MyFriendsDataBase getInstance(Context context) {
        if (myFriendsDataBase == null) {
            // 构建
            myFriendsDataBase = Room.databaseBuilder(
                    context,
                    MyFriendsDataBase.class,
                    "my_friend").build();
        }
        return myFriendsDataBase;
    }

    public abstract MyFriendsDao myFriendsDao();
}
